<div class="card">
  <div class="card-header">
    <div class="row">
      <div class="col col-md-6">
        <h5 class="card-title">RFID 列表</h5>
      </div>
      <div class="col col-md-6 text-end">
        <button class="btn btn-primary" type="button" (click)="create()">
          <i class="fa fa-plus me-1"></i>
          <span>新建 RFID</span>
        </button>
      </div>
    </div>
  </div>
  <div class="card-body" *ngIf="rfid.items">
    <ngx-datatable [rows]="rfid.items" [count]="rfid.totalCount" [list]="list" default>
      <ngx-datatable-column [name]="'序号'" [maxWidth]="50">
        <ng-template let-rowIndex="rowIndex" ngx-datatable-cell-template>
          {{ list.page * list.maxResultCount + rowIndex + 1 }}
        </ng-template>
      </ngx-datatable-column>

      <ngx-datatable-column [name]="'RFID 1'" [prop]="'rfid1'"></ngx-datatable-column>
      <ngx-datatable-column [name]="'创建日期'" [prop]="'creationDate'">
        <ng-template let-row="row" ngx-datatable-cell-template>
          {{ row.creationDate | date: 'yyyy-MM-dd HH:mm:ss' }}
        </ng-template>
      </ngx-datatable-column>
      <ngx-datatable-column [name]="'创建人'" [prop]="'creatorLoginName'"></ngx-datatable-column>
      <ngx-datatable-column [name]="'类型'" [prop]="'type'"></ngx-datatable-column>
      <ngx-datatable-column [name]="'业务内容'" [prop]="'businessContent'"></ngx-datatable-column>
      <ngx-datatable-column [name]="'RFID 2'" [prop]="'rfid2'"></ngx-datatable-column>
      <ngx-datatable-column [name]="'RFID 3'" [prop]="'rfid3'"></ngx-datatable-column>
      
      <ngx-datatable-column [name]="'操作'" [sortable]="false">
        <ng-template let-row="row" ngx-datatable-cell-template>
          <div class="d-flex">
            <button class="btn btn-sm btn-primary me-2" type="button" (click)="edit(row)">
              编辑
            </button>
            <button class="btn btn-sm btn-danger" type="button" (click)="delete(row)">
              删除
            </button>
          </div>
        </ng-template>
      </ngx-datatable-column>
    </ngx-datatable>
  </div>
</div> 